count, domid, refs, prot);
}
+int xc_gnttab_munmap(xc_gnttab *xcg,
+ void *start_address,
+ uint32_t count)
+{
+ return xcg->ops->u.gnttab.munmap(xcg, xcg->ops_handle,
+ start_address, count);
+}
+
+
/*
* Local variables:
* mode: C
return do_gnttab_map_grant_refs(xcg, h, count, &domid, 0, refs, prot);
}
-int xc_gnttab_munmap(xc_gnttab *xcg, void *start_address, uint32_t count)
+static int linux_gnttab_munmap(xc_gnttab *xcg, xc_osdep_handle h,
+ void *start_address, uint32_t count)
{
+ int fd = (int)h;
struct ioctl_gntdev_get_offset_for_vaddr get_offset;
struct ioctl_gntdev_unmap_grant_ref unmap_grant;
int rc;
* mmap() the pages.
*/
get_offset.vaddr = (unsigned long)start_address;
- if ( (rc = ioctl(xcg->fd, IOCTL_GNTDEV_GET_OFFSET_FOR_VADDR,
+ if ( (rc = ioctl(fd, IOCTL_GNTDEV_GET_OFFSET_FOR_VADDR,
&get_offset)) )
return rc;
/* Finally, unmap the driver slots used to store the grant information. */
unmap_grant.index = get_offset.offset;
unmap_grant.count = count;
- if ( (rc = ioctl(xcg->fd, IOCTL_GNTDEV_UNMAP_GRANT_REF, &unmap_grant)) )
+ if ( (rc = ioctl(fd, IOCTL_GNTDEV_UNMAP_GRANT_REF, &unmap_grant)) )
return rc;
return 0;
.map_grant_ref = &linux_gnttab_map_grant_ref,
.map_grant_refs = &linux_gnttab_map_grant_refs,
.map_domain_grant_refs = &linux_gnttab_map_domain_grant_refs,
+ .munmap = &linux_gnttab_munmap,
},
};
prot & PROT_WRITE);
}
-int xc_gnttab_munmap(xc_gnttab *xcg,
- void *start_address,
- uint32_t count)
+static int minios_gnttab_munmap(xc_gnttab *xcg, xc_osdep_handle h,
+ void *start_address,
+ uint32_t count)
{
+ int fd = (int)h;
int ret;
- ret = gntmap_munmap(&files[xcg->fd].gntmap,
+ ret = gntmap_munmap(&files[fd].gntmap,
(unsigned long) start_address,
count);
if (ret < 0) {
.map_grant_ref = &minios_gnttab_map_grant_ref,
.map_grant_refs = &minios_gnttab_map_grant_refs,
.map_domain_grant_refs = &minios_gnttab_map_domain_grant_refs,
+ .munmap = &minios_gnttab_munmap,
},
};